package ss;
//我是一个父类
public class Hero {
    private  String name;
    private int age;
    private int fightpower;
    private int defendpower;
    private String superpower;

    public Hero() {
        //for debug
        System.out.println("Mark：无参父类构造方法");
    }

    public Hero(String name, int age, int fightpower, int defendpower, String superpower) {
        System.out.println("Mark:有参父类构造方法");
        this.name = name;
        this.age = age;
        this.fightpower = fightpower;
        this.defendpower = defendpower;
        this.superpower = superpower;
    }

    public void setHeroInfo(String inputn, int inputa) {
        // Scanner input = new Scanner(System.in);
        name = inputn;
        age = inputa;
    }

    public void getHeroInfo() {
        System.out.println("英雄名： " + name);
        System.out.println("年龄： " + age);
    }

    protected void setPower(int inputf, int inputd, String inputs) {
        fightpower = inputf;
        defendpower = inputd;
        superpower = inputs;
    }

    protected void getPower() {
        System.out.println("攻击力： " + fightpower);
        System.out.println("防御力： " + defendpower);
        System.out.println("技能： " + superpower);
    }

    public void target() {
        //提高重写方法的访问权限
        System.out.println("守望和平");
    }
}